package com.zx.crowdfunding.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * SpringMVC配置类
 * 
 * @author 郑雪
 * @date 2021-12-31
 */
@Configuration
public class CrowdFundingWebMvcConfig implements WebMvcConfigurer {

	/**
	 * 直接把请求地址和视图名称关联起来，不必写handler方法了
	 */
	public void addViewControllers(ViewControllerRegistry registry) {
		
		// 添加view-controller
		registry.addViewController("/to/agree/protocol/page").setViewName("project-agree");
		registry.addViewController("/to/launch/project/page").setViewName("project-launch");
		registry.addViewController("/to/return/info/page").setViewName("project-return");
		registry.addViewController("/to/create/confirm/page").setViewName("project-confirm");
		registry.addViewController("/to/create/success/page").setViewName("project-success");
		
	}

}
